package com.deepocean.service.impl;

import com.deepocean.dao.CentrifugeDao;
import com.deepocean.entity.CentrifugeCondition;
import com.deepocean.entity.CentrifugeEntity;
import com.deepocean.entity.CentrifugeInAndOut1Hour;
import com.deepocean.service.ICentrifugeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class CentrifugeServiceImpl implements ICentrifugeService {
    @Autowired
    private CentrifugeDao centrifugeDao;
    @Override
    public boolean add(CentrifugeEntity centrifugeEntity) {
        String id = UUID.randomUUID().toString().replaceAll("-", "");
        centrifugeEntity.setId(id);
        return centrifugeDao.add(centrifugeEntity);
    }

    @Override
    public CentrifugeInAndOut1Hour getInAndOutInHour(String deviceId) {
        return centrifugeDao.getInAndOutInHour(deviceId);
    }

    @Override
    public List<CentrifugeEntity> getCentrifugeByCondition(CentrifugeCondition centrifugeCondition) {
        return centrifugeDao.getCentrifugeByCondition(centrifugeCondition);
    }
}
